package com.kingtsoft.study.webserivce;

import com.github.pagehelper.PageInfo;
import com.kingtsoft.study.model.StudyHomeworkDetail;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * Title:
 * Description:
 * Copyright: Copyright (c) 2017-03-30 下午3:00
 * Company: wondersgroup.com
 *
 * @author jerry.pan(潘健雷)
 * @version 1.0
 */
public interface WebStudyHomeworkDetailService {

    /**
     * 跳转到添加页面初始化
     *
     * @param mav
     * @param homeworkDetail
     * @return
     * @author jerry.pan
     * @date 2017-04-10 13:30:16
     */
    ModelAndView pageAddInit(ModelAndView mav, StudyHomeworkDetail homeworkDetail);


    /**
     * 跳转到编辑页面初始化
     *
     * @param mav
     * @param homeworkDetail
     * @return
     * @author jerry.pan
     * @date 2017-04-10 13:30:16
     */
    ModelAndView pageEditInit(ModelAndView mav, StudyHomeworkDetail homeworkDetail);


    /**
     * 跳转到查看页面初始化
     *
     * @param mav
     * @param homeworkDetail
     * @return
     * @author jerry.pan
     * @date 2017-04-10 13:30:16
     */
    ModelAndView pageViewInit(ModelAndView mav, StudyHomeworkDetail homeworkDetail);

    /**
     * 获取作业
     *
     * @param id 作业主键
     * @return 作业
     * @author jerry.pan
     * @date 2017-03-30 15:08:11
     */
    StudyHomeworkDetail load(String id);

    /**
     * 通过老师作业表主键和学生主键获取作业
     *
     * @param homeworkId 老师作业表主键
     * @return 作业
     * @author jerry.pan
     * @date 2017-04-01 12:39:56
     */
    StudyHomeworkDetail loadByHomeworkIdAndStudentId(String homeworkId, String studentId);

    /**
     * 增加/修改作业
     *
     * @param studyHomeworkDetail 作业
     * @author jerry.pan
     * @date 2017-03-31 16:11:29
     */
    StudyHomeworkDetail edit(StudyHomeworkDetail studyHomeworkDetail);

    /**
     * 获取作业的列表
     *
     * @return pageInfo
     * @author jerry.pan
     * @date 2017-03-30 15:08:11
     */
    PageInfo<StudyHomeworkDetail> listPage(PageInfo page, StudyHomeworkDetail studyHomeworkDetail);

    /**
     * 获取作业的列表
     *
     * @return list
     * @author jerry.pan
     * @date 2017-03-30 15:08:11
     */
    List<StudyHomeworkDetail> listAll(StudyHomeworkDetail studyHomeworkDetail);


    /**
     * 保存上传文件
     *
     * @param file
     * @param studyHomeworkDetail
     * @author jerry.pan
     * @date 2017-04-01 15:38:22
     */
    StudyHomeworkDetail saveUpload(MultipartFile file,StudyHomeworkDetail studyHomeworkDetail);


    /**
     * 下载文件
     * @param response
     * @param id
     */
    void downloadFile(HttpServletResponse response, String id);


    /**
     * 删除上传文件
     *
     * @param
     * @author jerry.pan
     * @date 2017-04-01 15:38:22
     */
    void deleteFile(String id);

    /**
     * 查询已经提交的作业
     *
     * @param page
     * @param studyHomeworkDetail
     * @return page info
     * @author jerry.pan
     * @date 2017-04-05 08:40:11
     */
    PageInfo<StudyHomeworkDetail> listCommittedPage(PageInfo page, StudyHomeworkDetail studyHomeworkDetail);
}
